﻿@model IEnumerable<Lucy.Models.Order>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Date)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Customer.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Jewel.Type)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Diamond.Clarity)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.TotalPrice)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PaymentType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Status)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Customer.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Jewel.Type)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Diamond.Clarity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TotalPrice)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PaymentType)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Status)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.OrderID }) |
            @Html.ActionLink("Details", "Details", new { id=item.OrderID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.OrderID })
        </td>
    </tr>
}

</table>
